<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F().drag</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F().drag</h2>
					<h3>概述 : 拖动组件</h3>
						
			<div class="desc">
				<div class="longdesc"><pre>可以设置拖动手柄，鼠标按下、移动、弹起的事件，限制范围等</pre></div>
			</div>
							<h3>语法1：F.drag(box, ops)</h3>
						<table class="args">
				<!--caption>参数列表：(2)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>box</strong></td><td>ID,Node,fdom</td><td>拖动框</td></tr>
									<tr><td><strong>ops</strong><em> (可选)</em></td><td>Object</td><td>拖动参数</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回drag链</td></tr>
			</table>
					<h3>语法2：ops参数</h3>
						<table class="args">
				<!--caption>参数列表：(5)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>handle</strong></td><td>ID,Node,fdom</td><td>拖动手柄</td></tr>
									<tr><td><strong>before</strong></td><td>Function</td><td>拖动前回调函数</td></tr>
									<tr><td><strong>running</strong></td><td>Function</td><td>拖动中回调函数</td></tr>
									<tr><td><strong>after</strong></td><td>Function</td><td>拖动后回调函数</td></tr>
									<tr><td><strong>limit</strong></td><td>Object</td><td>限制拖动范围</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回drag链</td></tr>
			</table>
					<h3>语法3：limit参数</h3>
						<table class="args">
				<!--caption>参数列表：(4)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>x1</strong></td><td>Number</td><td>左上角X坐标</td></tr>
									<tr><td><strong>y1</strong></td><td>Number</td><td>左上角Y坐标</td></tr>
									<tr><td><strong>x2</strong></td><td>Number</td><td>右下角X坐标</td></tr>
									<tr><td><strong>y2</strong></td><td>Number</td><td>右下角Y坐标</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回drag链</td></tr>
			</table>
				<div class="example">
			<h3>示例 : 简单拖动及复杂拖动</h3>
							<h5 xmlns="">CSS代码:</h5>
				<pre xmlns=""><code id="cssbox"></code></pre>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
								</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/48.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='177.html'>F().anime</a></span>&#12288;|&#12288;							<span><a href='75.html'>F.dialog</a></span>&#12288;|&#12288;							<span><a href='51.html'>F().slides</a></span>&#12288;|&#12288;							<span><a href='74.html'>F.pagination</a></span>&#12288;|&#12288;							<span><a href='80.html'>F().tree</a></span>&#12288;|&#12288;							<span><a href='50.html'>F.menu</a></span>&#12288;|&#12288;							<span><a href='32.html'>F.datePicker</a></span>&#12288;|&#12288;							<span><a href='28.html'>F.colorPicker</a></span>&#12288;|&#12288;							<span><a href='82.html'>F.canvas</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;">*{margin:0;padding:0;}
.siege{border:1px solid blue; width:400px; height:400px;}
#redbox{position:absolute; width:100px; height:100px; background-color:red;}
#bluebox{position:absolute; width:100px; height:100px; background-color:blue;}
#greenbar{width:100%; height:20px; background-color:green;}</textarea>
<textarea id="html" style="display:none;"><div class="siege"></div>
<div id="redbox" style="left:250px; top:250px;"></div>
<div id="bluebox" style="left:50px; top:50px;">
	<div id="greenbar"></div>
</div>
<img id="girl" src="http://www.qqai.net/upload/200905/0905160943754812.gif" /></textarea>
<textarea id="js" style="display:none;">F("redbox").drag({lockY:1}); //简单拖动
F("bluebox").drag({handle:"greenbar", x1:0,y1:0,x2:400,y2:400}); //复杂拖动
F("girl").drag();</textarea>
<textarea id="result" style="display:none;"></textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>